                             Game   Rules 
                                ChenWu
                     Thanks to my parents and my brother.
      Jan 14,2012 PM 09:39 .In my home the first day of winter holiday
	  
0:KEEP IT SIMPLE ,STUPID,BUT NOT NAIVE.WE ARE ARTIST.WE LOVE THE BEAUTY.

1:The environment prepared for the called procedure is provided by the the 
  caller.The caller needs to store the protected data and recover them when 
  back.
  
2:When write the assembley language file,the parameter needed by the called
  procedure should be pushed to the stack.The parameters enter the stack 
  according the cdecl rule,the parameters enter the stack from the right to 
  the left.
  
3:When come across the special data,we should use the #define(in the C code)
  or .equ(in the assembly code).It's a bad idea to use a real data in the 
  code instead of a variable or a  macro and so on.
  
4:When come across the usage of a special type ,for example ,the "int",
  "short" and so on,we should replace them with the "UMAX","UMIN","U4B" 
  and others which placed in the file "type.h". 
  
5:The note following the code should use the /* and */,just because it's 
  beautiful,and I like it. 
  
6:Who calls ,who provides the environment.Who destroys,who protect.
                  2012.4.4 18:19 in the library
7:Every pointer is translated to the actual physical address in the interface level.

8:   0~1M-1        ,Not used;
      1M~2M-1      , Stack for kernel;
      2M-6M-1       ,Kernel Code ;
      6M                , Memory Map Block;
      7M~7.5M-1   ,Kernel Process Message Buffer
      7.5M~8M-1   ,Kernel Process Signal  Buffer
      8M~9M-1      ,File System Buffer.
	  
9:  The Kernel Processes is divided into three level .
                   Driver,
	               Server,
				   Affair,
				   Interface.
				   
10: Driver Level:
             Keyboard Driver------------It translate the keyboard input to the unified code.
			 FS       Driver------------Manage the HD     in the size of 4 KB as a cluster.
			 MM       Driver------------Manage the memory in the size of 4 KB as a page.
11: Server Level:
             MMServer       ------------It control the mm driver.
             FSServer       ------------It control the fs driver.
			 
12: The message.value0  is treated as a pointer default.

13: The Memory Map Blocks are placed in the address of 6M~7M-1,so the struct size is free.
    each block have two pointers ,one points to the previous one ,the other one points to the 
	next struct.The first one have a member called "time" ,it contains the  number of the remain page
	number of the memory.
	  
14: The kernel process start from driver level ,then server level,then affair level,the last is interface 
    level.The interface level send a message to the server level that start the first user process.


15:As we know,the hardware vary differently.So if the process try to monitor the input device ,the device 
   process should a pointer which point to the processes.However the hardware is changing .So the pointer
   should be saved in the device process instead of the process.

16:We should follow the rule that when we say a address range A-B,just mean that the first we use is A ,the 
   last we use is the B ,the B presents the  address of the next beginning.

17:To design a kernel process ,
   first you should have a C source  file and  a H header file.
   Second you should change the content of the MAKEFILE and the file ,"common.h",
        which is used in all the C source file.
   Third ,you should activate it in a process .If it's a manager process .
        Ok ,we should activate it at the beginning of the opearating system .The file is "kernelinit.c".The function is "Init_Manager".
        Besides,we also should pay attention to the sequence the managers begin to work.
        If it's a common process ,we should  activate it in a manager process.
   OK.Let's pray now.May it work!

18:When in the interrupt ,I think we should not make the system reenter the interrupt.For example ,when a process try to get 
   the signal,however an interrupt which is going to add a signal occurs,and stops the process which is in the interrupt to 
   get a signal,some errors may happen.It means  when a resource may be changed by different objects,it may cause errors.So 
   when the interrupt change one resource,others can change it except the other interrupts.